export const formatTime = (time) => {
  const _time = new Date(time);
  const y = _time.getFullYear();
  const m = _time.getMonth() + 1;
  const d = _time.getDate();
  return `${y}-${m}-${d}`;
}

export const ajax = (url, method, data) => {
  const base_url = 'https://iplay666.fun';
  return new Promise((resolve,reject) =>{
    wx.request({
      url: `${base_url}${url}`,
      method: method ? method :'GET',
      data,
      success:(res)=>{
        resolve(res);
      },
      fail:(err)=>{
        reject(err);
      }
    })
  })
}